VT-d: fix RMRR related error handling
authorJan Beulich <jbeulich@suse.com>
Fri, 10 Oct 2014 08:54:21 +0000 (10:54 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 10 Oct 2014 08:54:21 +0000 (10:54 +0200)
commit8b99f4400b695535153dcd5d949b3f63602ca8bf
tree1284a9d66753eb7fc3619086259819cbead9c1fb
parent5f32d186a8b1eeb707cd9bc468d84335d562491c
VT-d: fix RMRR related error handling

- reassign_device_ownership() now tears down RMRR mappings (for other
  than Dom0)
- to facilitate that, rmrr_identity_mapping() now deals with both
  establishing and tearing down of these mappings (the open coded
  equivalent in intel_iommu_remove_device() is being replaced at once)
- intel_iommu_assign_device() now unrolls the assignment upon RMRR
  mapping errors
- intel_iommu_add_device() now returns consistent values upon RMRR
  mapping failures (was: failure when last iteration ran into a
  problem, success otherwise)
- intel_iommu_remove_device() no longer special cases Dom0 (it only
  ever gets called for devices removed from the _system_, not a domain)
- rmrr_identity_mapping() now returns a proper error indicator instead
  of -1 when intel_iommu_map_page() failed

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/drivers/passthrough/vtd/iommu.c